import Vue from 'vue'
import App from './entry/Login'
//这里引入router,否则不能使用$router相关方法
import router from './router/login.router'
import iView from 'iview'

// import 'iview/dist/styles/iview.css'
import '../my-theme/index.less'
import identify from './views/login/identify/identify'
import axios from 'axios'
import Qs from 'qs'
import VueAxios from 'vue-axios'


var axios_instance = axios.create({
    baseURL:'http://47.101.180.43:8080', //自行修改url,
    transformRequest: [function (data) {
    data = Qs.stringify(data);
    return data;
    }],
    headers:{'Content-Type':'application/x-www-form-urlencoded',
    'Access-Control-Allow-Credentials': 'true'}
    })
Vue.use(VueAxios, axios_instance)
/**axios不是vue插件，所以需要这样配置，可以通过this.$http代替axios，而不用每个.vue里面再去import axios了 */
Vue.prototype.$ajax=axios
/**运行跨域请求*/
axios.defaults.withCredentials=true

Vue.use(iView);
Vue.use(identify)
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})